<!--<?php
print <<<EOT
-->

<!--Content Start-->
<table width="95%" border="0" align="center">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>
    
      <form action="p_product.php" method="post" name="form1" enctype="multipart/form-data">
      <table width="60%" align="left">
      <tr><td>
      <table width="60%" border="0" align="center">
        <tr> 
          <td align="right">
            <a href="p_product.php"><img src="../images/admin/bt_cancel.gif" border="0" /></a>
            <input type="image" src="../images/admin/bt_save.gif" width="76" height="22"  > 
          </td>
        </tr>
      </table>
      </td></tr>
    
      <tr><td>
      <table width="95%" border="0" align="center">
        <tr> 
          <td align="right">&nbsp; </td>
        </tr>
        <tr> 
          <td>
            <table border="0" cellspacing="0" cellpadding="2">
              <tr valign="vtop"> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr valign="vtop"> 
                <td>code :</td>
                <td>
                  <input type="text" class="text" name="code" value="$code">	  
                  <input name="action" type="hidden" value="add">
                </td>
              </tr>              
              <tr valign="vtop"> 
                <td>Name :</td>
                <td><textarea class="text" name="name" cols="40" rows="2"  ></textarea></td>
              </tr>
			 <!-- <tr valign="vtop"> 
                <td>Name Chinese:</td>
                <td><textarea class="text" name="namezh" cols="40" rows="2"  ></textarea></td>
              </tr>		-->	  
              <tr valign="vtop"> 
                <td>Small Picture :</td>
                <td><input type="file" class="text" name="up_small_pic" size=50></td>
              </tr>
              <tr valign="vtop"> 
                <td>Picture :</td>
                <td><input type="file" class="text" name="up_pic" size=50></td>
              </tr>
              <tr valign="vtop"> 
                <td>Finish Shown :</td>
                <td><input type="text" class="text" name="finishshown" value=""><input type="hidden" class="text" name="finishshownzh" value=""></td>
              </tr>		
			   
			    <tr valign="vtop"> 
                <td>Fabric Shown :</td>
                <td><select id="fabricshown" name="fabric_id" >
				<option value='0' >Select--</option>
				    $fabrics
				</select>
				
				</td>
              </tr>	
			  	
			  <tr valign="vtop"> 
                <td>Leather Shown :</td>
                <td>
				<select id="leathershown" name="leather_id" >
				<option value='0'>Select--</option>
				    $leathers
				</select>
				</td>
              </tr>	 
			  	 <!-- 
              <tr valign="vtop"> 
                <td>Fabric Shown :</td>
                <td><input type="text" class="text" name="fabricshown" value=""></td>
              </tr>		
			 <tr valign="vtop"> 
                <td>Fabric Shown Chinese :</td>
                <td><input type="text" class="text" name="fabricshownzh" value=""></td>
              </tr>	
              <tr valign="vtop"> 
                <td>Leather Shown :</td>
                <td><input type="text" class="text" name="leathershown" value=""></td>
              </tr>	
			 <tr valign="vtop"> 
                <td>Leather Shown Chinese:</td>
                <td><input type="text" class="text" name="leathershownzh" value=""></td>
              </tr>-->
			   
			  		
              <tr valign="vtop"> 
                <td>Marble Shown :</td>
                <td><input type="text" class="text" name="marbleshown" value=""></td>
              </tr>	
			 <!--  <tr valign="vtop"> 
                <td>Marble Shown Chinese:</td>
                <td><input type="text" class="text" name="marbleshownzh" value=""></td>
              </tr>	-->
			   
			     
			  
			  							
              <tr valign="vtop"> 
                <td>Depth :</td>
                <td><input type="text" class="text" name="length" value=""> CM</td>
              </tr>
              <tr valign="vtop"> 
                <td>Width :</td>
                <td><input type="text" class="text" name="width" value=""> CM</td>
              </tr>
              <tr valign="vtop"> 
                <td>Height :</td>
                <td><input type="text" class="text" name="height" value=""> CM</td>
              </tr>
              
              <tr valign="vtop"> 
                <td>Depth :</td>
                <td><input type="text" class="text" name="length2" value=""> INCH</td>
              </tr>
              <tr valign="vtop"> 
                <td>Width :</td>
                <td><input type="text" class="text" name="width2" value=""> INCH</td>
              </tr>
              <tr valign="vtop"> 
                <td>Height :</td>
                <td><input type="text" class="text" name="height2" value=""> INCH</td>
              </tr>
              
              <tr valign="vtop"> 
                <td>Cbm :</td>
                <td><input type="text" class="text" name="cbm" value=""></td>
              </tr>
              <tr valign="vtop"> 
                <td>Cuft :</td>
                <td><input type="text" class="text" name="cuft" value=""></td>
              </tr>
              
              
              <tr valign="vtop"> 
                <td>Price : </td>
                <td>
               <!--     <input type="text" class="text" name="price_1" size="10"  value=  > (USD) Mixed Container Price <br> 
                  <input type="text" class="text" name="price_2" size="10" value=  > (USD) Direct Container Price <br>-->
                  <input type="text" class="text" name="price_3" size="10" value=  > EUR (€) <br> 
                </td>
              </tr>
			  <tr><td>Auction:</td><td><select class="select" name="auction" id="sel_auction" onchange="auction_change()"><option value="0">No</option><option value="1" selected="selected">Yes</option></select></td></tr>
			  <tr class="clearance"><td>Discount:</td><td><select class="select" name="discount"><option value="0">Select--</option>
<!--
EOT;
for($i=0; $i<51; $i++){
    print <<<EOT
-->
			  <option value="{$i}">{$i}</option>
<!--
EOT;
}
-->			  
			  </select>%</td></tr>

			<tr class="clearance"><td>Interval:</td><td><select class="select" name="interval"><option value="0">Select--</option>
<!--
EOT;
for($i=0; $i<51; $i++){
    print <<<EOT
-->
			  <option value="{$i}">{$i}</option>
<!--
EOT;
}
-->	</select>Days</td></tr>

			<tr class="clearance"><td>Start Date:</td><td><input type="text" class="text" id="time_start" name="time_start" size="20" value="{date('Y-m-d',time())}"></td></tr>
			<tr class="clearance"><td>End Date:</td><td><input type="text" class="text" id="time_end" name="time_end" size="20" value="{date('Y-m-d',time())}"  ></td></tr>
			<tr class="clearance"><td>Sold Out:</td><td><select class="select" name="is_soldout"><option value="0">Select--</option><option value="1" selected>Yes</option><option value="0">No</option></select></td></td></tr>    
              <tr valign="vtop"> 
                <td>New Item :</td>
                <td>							  
                  <select class="select" name="new_flag"  >
                  <option value=1>Yes</option><option value=0 selected>No</option></select> 
                </td>
              </tr>              
              <tr valign="vtop"> 
                <td>Hidden in product :</td>
                <td>							  
                  <select class="select" name="hidden_flag"  >
                  <option value=1>Yes</option><option value=0 selected>No</option></select> 
                </td>
              </tr>
                <tr valign="vtop">
                    <td>Collection:</td>
                    <td><select class="select" name="selCollection">
                    <option value='0'>Select--</option>
<!--
EOT;
for($i=0; $i<count($aryCollection); $i++){
    print <<<EOT
-->
    <option value='{$aryCollection[$i]["id"]}'>{$aryCollection[$i]["name"]}</option>
 <!--
EOT;
} print <<<EOT
-->                        </select>
                    </td>
                </tr>
                  <tr valign="vtop">
                    <td valign="top">Setting:
                    </td>
                    <td>           
						
					 <table width="100%" border="0" cellspacing="1" cellpadding="1" class="tb">
<!--
EOT;
$str="";
for($i=0; $i<count($arySetting); $i++){
  $ids="iput_".$i;
    $str.='<tr class="tbcontent1"><td><input type="checkbox" value='.$arySetting[$i]['id'].'  id="'.$ids.'"  name="selSetting[]" onchange="if ( this.checked==true){seetingseq_'.$i.'.disabled=false;} else {seetingseq_'.$i.'.disabled=true;}"><label     for="'.$ids.'">'.$arySetting[$i]["name"].'</label></td><td>
	<input id="seetingseq_'.$i.'" type="text" disabled="disabled" name="seeting_seq['.$i.']" size="3">
	</td></tr>'; 

} 

echo <<<EOT

-->	 
{$str}
 </table>
                    </td>
                </tr>
                <tr valign="vtop">
                    <td>Style / Period:
                    </td>
                    <td><select class="select" name="selStyle">
                    <option value='0'>Select--</option>
<!--
EOT;
for($i=0; $i<count($aryStyle); $i++){
    print <<<EOT
-->
    <option value='{$aryStyle[$i]["id"]}'>{$aryStyle[$i]["name"]}</option>
 <!--
EOT;
} print <<<EOT
-->        
                        </select>
                    </td>
                </tr>
                <tr valign="vtop">
                    <td>Finish categories
                    </td>
                    <td><select class="select" name="selFinishes">
                    <option value='0'>Select--</option>
<!--
EOT;
for($i=0; $i<count($aryFinishes); $i++){
    print <<<EOT
-->
    <option value='{$aryFinishes[$i]["id"]}'>{$aryFinishes[$i]["name"]}</option>
 <!--
EOT;
} print <<<EOT
-->     
                        </select>
                    </td>
                </tr>
                <tr valign="vtop">
                    <td>
                        Product info:</td>
                    <td>
                        <textarea class="text" cols="40" name="pinfo" rows="4"></textarea>
                    </td>
                </tr>
				 <!--  <tr valign="vtop">
                    <td>
                        Product info Chinese:</td>
                    <td>
                        <textarea class="text" cols="40" name="pinfozg" rows="4"></textarea>
                    </td>
                </tr>-->
              <tr valign="vtop"> 
                <td>Description :</td>
                <td><textarea class="text" name="comment" cols="40" rows="4"  ></textarea></td>
              </tr>
			  
			
             <!-- <tr valign="vtop"> 
                <td>Description Chinese :</td>
                <td><textarea class="text" name="commentzh" cols="40" rows="4"  ></textarea></td>
              </tr>
              -->
              <tr valign="vtop"> 
                <td>Inventory :</td>
                <td>
                
                  <table width="100%" border="0" cellspacing="1" cellpadding="1" class="tb">
                    <tr class="tbheader">
                      <td align="left">Inventory</td>
                      <td align="center">Available Qty</td>
                      <td align="center">Special Price</td>
                    </tr>

<!--
EOT;
for($i=0; $i<$inventory_ary_num; $i++){
    // ΪHK warehouse Ҫ2sp
    if ($inventory_ary[$i]['type'] == 1) {
        $ovr_desc = 'Ovr ';
        $hk_sp = ' NL <input id="sp2_' . $inventory_ary[$i]['id'] . '" value="' . $inventory_sp2_ary[$inventory_ary[$i]['id']] . '" type="text" name="sp2_ary[' . $inventory_ary[$i]['id'] . ']" size="5"  disabled="disabled" />';
    } else {
        $ovr_desc = '';
        $hk_sp = '<input id="sp2_' . $inventory_ary[$i]['id'] . '" value="0" type="hidden" name="sp2_ary[' . $inventory_ary[$i]['id'] . ']"  disabled="disabled" />';
    }
    print <<<EOT
-->
                    
                    <tr class="tbcontent1">
                      <td align="left"><input type="checkbox" name="inventory_id[]" value="{$inventory_ary[$i]['id']}" onchange="if ( this.checked==true){qty_{$inventory_ary[$i]['id']}.disabled=false;sp_{$inventory_ary[$i]['id']}.disabled=false;sp2_{$inventory_ary[$i]['id']}.disabled=false;} else {qty_{$inventory_ary[$i]['id']}.disabled=true;sp_{$inventory_ary[$i]['id']}.disabled=true;sp2_{$inventory_ary[$i]['id']}.disabled=true;}" />{$inventory_ary[$i]['name']}</td>
                      <td align="center"><input id="qty_{$inventory_ary[$i]['id']}" type="text" name="qty_ary[{$inventory_ary[$i]['id']}]" size="3" disabled="disabled" /></td>
                      <td align="center">{$ovr_desc}<input id="sp_{$inventory_ary[$i]['id']}" type="text" name="sp_ary[{$inventory_ary[$i]['id']}]" size="8" disabled="disabled" />{$hk_sp}</td>
                    </tr>
                    
<!--
EOT;
} print <<<EOT
--> 

                  </table>
                    
                </td>
              </tr>
              <tr valign="vtop"> 
                <td>category :</td>
                <td>
                    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="tb">
                    <tr class="tbheader">
                      <td align="left">Category/Sub Category</td>
                      <td align="center">Product Sequence</td>
                    </tr>
$out_cate
                    </table>
                </td>
              </tr>              
              <tr valign="vtop"> 
                <td>Related Items :</td>
                <td><table cellspacing="1" cellpadding="1" border="0">
                    <tbody><tr> 
                      <td><input type="text" onfocus="this.value=''" value="Enter code ..." size="20" name="related_code" class="text" id="related_code"></td>
                      <td><input type="image" src="../images/admin/bt_add.gif" onclick="add_item();return false;" name="image"></td>
			          <td><img width="30" src="../images/admin/shim.gif"></td>
                    </tr>
                  </tbody></table>
				  <table class="tb" width="100%" cellspacing="1" cellpadding="1" border="0">
				  <tbody id="item_list"><tr class="tbheader"><td width="20%">code</td><td width="50%">name</td><td width="15%">seq</td><td width="15%">remove</td></tr></tbody></table>
				  
				  </td>
              </tr>           
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
     </td></tr>
    
      <tr><td>
      <table width="60%" border="0" align="center">
        <tr> 
          <td align="right">
            <input type="image" src="../images/admin/bt_cancel.gif" width="78" height="23" onclick="Redirect('product_menu.php',1);return false;"> 
            <input type="image" src="../images/admin/bt_save.gif" width="76" height="22" > 
          </td>
        </tr>
      </table>
      </td></tr>
      </table>
      </form>

      <p>&nbsp;</p></td>
  </tr>
</table>
<script type="text/javascript">
function add_item()
{
	var related_code = $('#related_code').val();
	if(related_code == '')
	{
		alert('Please enter product code');
		return;
	}
	if($('#tr_'+related_code).size() > 0)
	{
		alert('Related item exists!');
		return;
	}
	$.ajax({
		url:'getdo.php',
		type:'POST',
		data:{'code':related_code,'type':43},
		dataType:'json',
		success:function(d){
			if(d.id > 0)
			{
				$('#item_list').append('<tr class="tbcontent1" id="tr_'+d.code+'"><td><input type="hidden" name="related_id[]" value="'+d.id+'"/>'+d.code+'</td><td>'+d.name+'</td><td><input type="text" class="text" name="seq[]" size="5" value="'+$('#item_list').size()+'"/></td><td><a href="javascript:;" onclick="remove(this)" title="Remove">Remove</a></td></tr>');
			}
			else
			{
				alert('Related item doesn\'t exists!');
			}
		}
	});
}
function remove(o)
{
$(o).parent().parent().remove();
}

function auction_change()
{
	if($('#sel_auction').val() == 1)
	{
		$('.clearance').show();
	}
	else
	{
		$('.clearance').hide();
	}
}
$(function(){
	auction_change();
});
</script>
<!--Content End-->

<!--
EOT;
?>-->